﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace PuzzleCoop
{
    public class Slot
    {
        public static int SizeA = 500;
        public static int SizeE = 50;

        public Point coord; // dento do tabuleiro
        
        public Texture2D textureA;
        public Texture2D textureE;
        public Vector2 originA;
        public Vector2 originE;

        public Rectangle sourceRectangle;

        public Slot(Texture2D textureA, Texture2D textureE, Point coord)
        {
            this.coord = coord; // a posição do slot não é referente ao centro, é referente ao canto superior esquerdo
            this.textureA = textureA;
            this.textureE = textureE;
            originA = new Vector2(textureA.Width / 2, textureA.Height / 2);
            originE = new Vector2(textureE.Width / 2, textureE.Height / 2);
            sourceRectangle = new Rectangle(0, 0, textureA.Width, textureA.Height);
        }

        public virtual void Update(GameTime gameTime)
        {
        }

        public virtual void DrawA(SpriteBatch spriteBatch, Vector2 boardPosA)
        {
            spriteBatch.Draw(textureA, boardPosA + new Vector2(coord.X * SizeA, coord.Y * SizeA), sourceRectangle, Color.White, 0, originA, 1, SpriteEffects.None, 0);
        }

        public virtual void DrawE(SpriteBatch spriteBatch, Vector2 boardPosE)
        {
            spriteBatch.Draw(textureE, boardPosE + new Vector2(coord.X * SizeE, coord.Y * SizeE), null, Color.White, 0, originE, 1, SpriteEffects.None, 0);
        }
    }
}
